package com.young.test.util;

import org.apache.log4j.Logger;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

public class InstantiationTracingBeanPostProcessor implements BeanPostProcessor {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(InstantiationTracingBeanPostProcessor.class);

	public Object postProcessBeforeInitialization(Object bean, String beanName)
			throws BeansException {
		return bean;
	}

	public Object postProcessAfterInitialization(Object bean, String beanName)
			throws BeansException {
		logger.info("Bean '" + beanName + "' created : " + bean.toString());
		return bean;
	}

}
